package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.envers.Audited;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by VegetaKo on 2016/11/29.
 */

@Entity
@Table(name = "salesman_base", catalog = "")
public class SalesmanBase extends BaseEntity {
    private String organizationCode;
    private String salesmanNo;
    private String salesmanName;
    private String password;
    private String salesmanLevel;
    private String salesmanParent;
    private String salesmanWxopenid;
    private String mobile;
    private BigDecimal nights;
    private BigDecimal members;
    private BigDecimal rewards;
    private String sta;
    private String qrCode;

    public enum SalesmanBase_{
        salesmanNo,salesmanName,password,salesmanLevel,salesmanParent,salesmanWxopenid,mobile,nights,members,rewards,sta,qrCode
    }

    @Basic
    @Column(name = "organization_code")
    public String getOrganizationCode() {
        return organizationCode;
    }

    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    }

    @Basic
    @Column(name = "salesman_no", nullable = true, length = 64)
    public String getSalesmanNo() {
        return salesmanNo;
    }

    public void setSalesmanNo(String salesmanNo) {
        this.salesmanNo = salesmanNo;
    }

    @Basic
    @Column(name = "salesman_name", nullable = true, length = 32)
    public String getSalesmanName() {
        return salesmanName;
    }

    public void setSalesmanName(String salesmanName) {
        this.salesmanName = salesmanName;
    }

    @Basic
    @Column(name = "password", nullable = true, length = 32)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "salesman_level", nullable = true, length = 16)
    public String getSalesmanLevel() {
        return salesmanLevel;
    }

    public void setSalesmanLevel(String salesmanLevel) {
        this.salesmanLevel = salesmanLevel;
    }

    @Basic
    @Column(name = "salesman_parent", nullable = true, length = 16)
    public String getSalesmanParent() {
        return salesmanParent;
    }

    public void setSalesmanParent(String salesmanParent) {
        this.salesmanParent = salesmanParent;
    }

    @Basic
    @Column(name = "salesman_wxopenid", nullable = true, length = 32)
    public String getSalesmanWxopenid() {
        return salesmanWxopenid;
    }

    public void setSalesmanWxopenid(String salesmanWxopenid) {
        this.salesmanWxopenid = salesmanWxopenid;
    }

    @Basic
    @Column(name = "mobile", nullable = true, length = 16)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "nights", nullable = true, precision = 12,scale = 2)
    public BigDecimal getNights() {
        return nights;
    }

    public void setNights(BigDecimal nights) {
        this.nights = nights;
    }

    @Basic
    @Column(name = "members", nullable = true, precision = 12,scale = 2)
    public BigDecimal getMembers() {
        return members;
    }

    public void setMembers(BigDecimal members) {
        this.members = members;
    }

    @Basic
    @Column(name = "rewards", nullable = true, precision = 12,scale = 2)
    public BigDecimal getRewards() {
        return rewards;
    }

    public void setRewards(BigDecimal rewards) {
        this.rewards = rewards;
    }

    @Basic
    @Column(name = "sta", nullable = true, length = 16)
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Basic
    @Column(name = "qr_code", nullable = true, length = 128)
    public String getQrCode() {
        return qrCode;
    }

    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SalesmanBase that = (SalesmanBase) o;

        if (salesmanNo != null ? !salesmanNo.equals(that.salesmanNo) : that.salesmanNo != null) return false;
        if (salesmanName != null ? !salesmanName.equals(that.salesmanName) : that.salesmanName != null) return false;
        if (password != null ? !password.equals(that.password) : that.password != null) return false;
        if (salesmanLevel != null ? !salesmanLevel.equals(that.salesmanLevel) : that.salesmanLevel != null) return false;
        if (salesmanParent != null ? !salesmanParent.equals(that.salesmanParent) : that.salesmanParent != null) return false;
        if (salesmanWxopenid != null ? !salesmanWxopenid.equals(that.salesmanWxopenid) : that.salesmanWxopenid != null) return false;
        if (mobile != null ? !mobile.equals(that.mobile) : that.mobile != null) return false;
        if (nights != null ? !nights.equals(that.nights) : that.nights != null) return false;
        if (members != null ? !members.equals(that.members) : that.members != null) return false;
        if (rewards != null ? !rewards.equals(that.rewards) : that.rewards != null) return false;
        if (sta != null ? !sta.equals(that.sta) : that.sta != null) return false;
        if (qrCode != null ? !qrCode.equals(that.qrCode) : that.qrCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = salesmanNo != null ? salesmanNo.hashCode() : 0;
        result = 31 * result + (salesmanName != null ? salesmanName.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (salesmanLevel != null ? salesmanLevel.hashCode() : 0);
        result = 31 * result + (salesmanParent != null ? salesmanParent.hashCode() : 0);
        result = 31 * result + (salesmanWxopenid != null ? salesmanWxopenid.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        result = 31 * result + (nights != null ? nights.hashCode() : 0);
        result = 31 * result + (members != null ? members.hashCode() : 0);
        result = 31 * result + (rewards != null ? rewards.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (qrCode != null ? qrCode.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SalesmanBase{" +
                "lhotelGroupCode='" + getLhotelGroupCode() + '\'' +
                "lhotelCode='" + getLhotelCode() + '\'' +
                "salesmanNo='" + salesmanNo + '\'' +
                ", salesmanName='" + salesmanName + '\'' +
                ", password='" + password + '\'' +
                ", salesmanLevel='" + salesmanLevel + '\'' +
                ", salesmanParent='" + salesmanParent + '\'' +
                ", salesmanWxopenid='" + salesmanWxopenid + '\'' +
                ", mobile='" + mobile + '\'' +
                ", nights=" + nights +
                ", members=" + members +
                ", rewards=" + rewards +
                ", sta='" + sta + '\'' +
                ", qrCode='" + qrCode + '\'' +
                '}';
    }
}
